using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FireStarterModeller.BO;
using FireStarterModeller.Logic;
using FireStarterModeller.Test.BO;
using Habanero.BO;
using NUnit.Framework;

namespace FireStarterModeller.Test.Logic
{
    [TestFixture]
    public class TestNonValidatingTransactionCommitter
    {
        #region Setup/Teardown
        [TestFixtureSetUp]
        public virtual void TestFixtureSetup()
        {
            TestUtilsLogic.SetupFixture();
        }

        [SetUp]
        public virtual void SetupTest()
        {
            TestUtilsLogic.WaitForGC();
        }

        [TearDown]
        public virtual void TearDownTest()
        {
        }
        #endregion
        [Test]
        public void Test_PersistNonValidBo()
        {
            //---------------Set up test pack-------------------
            DMSolution dmSolution = new DMSolution();
            NonValidatingTransactionCommitter transactionCommitter = new NonValidatingTransactionCommitter(new DataStoreInMemory());
            transactionCommitter.AddBusinessObject(dmSolution);
            //-------------Assert Preconditions -------------

            //---------------Execute Test ----------------------
            transactionCommitter.CommitTransaction();
            //---------------Test Result -----------------------
            Assert.IsTrue(transactionCommitter.CommitSuccess);
        }
    }
}
